package com.medusa.aps.business.model.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

@Getter
public enum EquipmentStatus {

    /**
     * 使用中
     */
    USING(1, "使用中"),

    /**
     * 空闲
     */
    IDLE(2, "空闲"),

    /**
     * 报废
     */
    SCRAP(3, "报废"),


    /**
     * 空闲中
     */
    IDLE_SCRAP(4, "维修中"),
    ;

    @EnumValue
    private final Integer value;

    private final String desc;

    EquipmentStatus(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static EquipmentStatus getByDesc(String desc) {
        for (EquipmentStatus equipmentStatus : EquipmentStatus.values()) {
            if (equipmentStatus.getDesc().equals(desc)) {
                return equipmentStatus;
            }
        }
        return null;
    }
}
